#include <iostream>
using namespace std;
#define int long long
 
int t;
int n, a, b;
 
int fun()
{
    if(n <= 2)
        return min(a, b);
    int ret = 0;
    if(a * 3 < b * 2) // 尽可能的选择双⼈船
    {
        ret += n / 2 * a;
        n %= 2;
        if(n)
            ret += min(min(a, b), b - a);
    }
    else // 尽可能的选择三⼈船
    {
        ret += n / 3 * b;
        n %= 3;
        if(n == 1)
            ret += min(min(a, b), 2 * a - b);
        if(n == 2)
            ret += min(min(a, b), 3 * a - b);
    }
    return ret;
}
 
signed main()
{
    cin >> t;
    while(t--)
    {
        cin >> n >> a >> b;
        cout << fun() << endl;
    }
 
    return 0;
}